﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Text1();
            Text2();
            Text3();

        }
        public static void Text1()
        {
            int[] arr = new int[10];
            ArrayList lstRdm = new ArrayList();
            for (int i = 1; i <= 10; i++) lstRdm.Add(i);
            Random rd = new Random();
            for (int i = 0; i < arr.Length; i++)
            {
                int rIndex = rd.Next(0, lstRdm.Count);
                arr[i] = Convert.ToInt32(lstRdm[rIndex]);
                lstRdm.RemoveAt(rIndex);
            }
            foreach (int a in arr)
            {
                Console.WriteLine(a);
            }

        }
        public static void Text2()
        {
            Random rd = new Random();
            double a = rd.NextDouble()*(5-0);
            a = Math.Round(a,2);
            Console.WriteLine(a);
        }
        public static void Text3()
        {
            Random rd = new Random();
            double b = Math.Round(rd.NextDouble() * (7 - 4) + 4, 2);
            Console.WriteLine("数字是"+b);


        }
    }
}
